<template>
  <div class="body_contain">
    <div class="maptop" v-if="routerLine!=='class'">
      <h3 style="margin-left:30px;color:#404040">森林全景</h3>
    </div>
    <imageMap v-if="imageMapVisible" :map_id="map_id"></imageMap>
    <realMap v-if="realMapVisible" :map_id="map_id"></realMap>
  </div>
</template>

<script>
import realMap from './3dMap'
import imageMap from "./imageMap";
import {mapActions} from "vuex";

export default {
  name: 'navigate',
  components: {
    imageMap,
    realMap
  },
  props: ['routerLine'],
  data() {
    return {
      imageMapVisible: false,
      realMapVisible: false,
      map_id: 0
    }
  },
  create() {
  },
  mounted() {
    this.InitFn()
  },
  methods: {
    ...mapActions(['getSetting']),
    InitFn() {
      this.getSetting().then(res => {
        if (res.vo.map_id) {
          this.map_id = res.vo.map_id
          this.realMapVisible = true
        } else {
          this.imageMapVisible = true
        }
      });
    },
  }
}
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
.body_contain {
  width: 100%;
  height: 100%;
}
.maptop {
  height: 50px;
  line-height: 50px;
}
</style>
